<!doctype html>
<html  class="x-admin-sm">
<head>
	<meta charset="UTF-8">
	<title>后台登录-X-admin2.2</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/login.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="./js/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/scarecrow/scarecrowRequest_scarecrow.min.js"></script>
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <!--[if lt IE 9]>
      <script src="./js/html5.min.js"></script>
      <script src="./js/respond.min.js"></script>
    <![endif]-->
    <style>
        .wechatLogin{
            width: 120px;
            height: 120px;
            margin: auto;
            display: block;
            margin-top: 100px;
            cursor: pointer;
        }

        .wechatLogin:hover{
            width: 140px;
            height: 140px;
            transition: .1s ease-out;
        }
    </style>
</head>
<body class="login-bg">
    
    <div class="login layui-anim layui-anim-up">
        <div class="message">Lumen-xadmin</div>
        <div id="darkbannerwrap"></div>

        <img src="/admin/images/wechat.png" class="wechatLogin">
    </div>

    <script>
        //获取URL中参数
        function getQueryVariable(variable)
        {
            var query = window.location.search.substring(1);
            var vars = query.split("&");
            for (var i=0;i<vars.length;i++) {
                var pair = vars[i].split("=");
                if(pair[0] == variable){return pair[1];}
            }
            return(false);
        }

        $(function  () {
            layui.use('form', function(){
              var form = layui.form;
              // layer.msg('玩命卖萌中', function(){
              //   //关闭后的操作
              //   });
              //监听提交
              $(".wechatLogin").on('click', function(){

                  // let url = "/wechat/login/pc";
                  // scarecrowRequest().get(url, (data)=>{
                  //     if (data.status == "YES") {
                  //         location.href=data.data
                  //     } else {
                  //         layer.msg(data.info);
                  //     }
                  // }, (e)=>{
                  //     layer.msg(e.message)
                  // });

                  //上面才是真正Oauth的授权登录流程，这里只是因为没有微信的应用我们模拟的微信授权成功
                  location.href = "/wechat/login/redirectloginpc?code=oUfEI0YgmswunUTYXZ50ElzDm7sg"
                return false;
              });

                var baseApiScToken = getQueryVariable('API-SC-TOKEN');
                if (baseApiScToken != false && baseApiScToken!="") {
                    var token = window.atob(baseApiScToken);
                    window.localStorage.setItem('SC-API-TOKEN',token);
                    location.href='wechatindex.html'
                }
            });
        })
    </script>
    <!-- 底部结束 -->
    <script>
    //百度统计可去掉
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
</body>
</html>